package com.atserver.listener;

import com.atserver.windows.CoordinateWindow;
import com.atserver.windows.ScannerWindow;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

/**
 * @program: atserver
 * @Description: 坐标获取鼠标监听
 * @author: Mr.Cheng
 * @date: 2022/6/14 11:19 上午
 */
public class CoordinateMouseListener implements MouseListener {

    private CoordinateWindow coordinateWindow;
    private ScannerWindow scannerWindow;

    public CoordinateMouseListener(CoordinateWindow coordinateWindow) {
        this.coordinateWindow = coordinateWindow;
    }

    public CoordinateMouseListener(CoordinateWindow coordinateWindow, ScannerWindow scannerWindow) {
        this.coordinateWindow = coordinateWindow;
        this.scannerWindow = scannerWindow;
    }

    /**
     * Invoked when the mouse button has been clicked (pressed
     * and released) on a component.
     *
     * @param e
     */
    @Override
    public void mouseClicked(MouseEvent e) {
        coordinateWindow.dispose();
    }

    /**
     * Invoked when a mouse button has been pressed on a component.
     *
     * @param e
     */
    @Override
    public void mousePressed(MouseEvent e) {

    }

    /**
     * Invoked when a mouse button has been released on a component.
     *
     * @param e
     */
    @Override
    public void mouseReleased(MouseEvent e) {

    }

    /**
     * Invoked when the mouse enters a component.
     *
     * @param e
     */
    @Override
    public void mouseEntered(MouseEvent e) {

    }

    /**
     * Invoked when the mouse exits a component.
     *
     * @param e
     */
    @Override
    public void mouseExited(MouseEvent e) {

    }
}
